package com.lh.user.enumm;

/**
 * 数据校验数据类型
 *
 * @author liuhe
 * @date 2020/07/02
 */
public enum DataTypeEnum {
    UNKNOWN(0, "未知"),
    USERNAME(1, "用户名"),
    PHONE(2, "手机号");

    private Integer dataType;
    private String info;

    DataTypeEnum(int dateType, String info) {
        this.dataType = dateType;
        this.info = info;
    }

    public Integer getDataType() {
        return dataType;
    }

    public static DataTypeEnum of(Integer dataType) {
        if (dataType == 1) {
            return USERNAME;
        } else if (dataType == 2) {
            return PHONE;
        } else {
            return UNKNOWN;
        }
    }
}
